package com.seek.authcheck.constants;

import org.apache.commons.lang.StringUtils;

/**
 * 认证产品枚举
 **/
public enum AuthProductEnum {
  CERTCARD("certcard", "0001", "certCardAuthCheck","身份证认证"),
  CARRIER("carrier", "0003", "carrierAuthCheck","运营商认证"),
  ALIPAY("alipay", "0004","alipayAuthcheck", "支付宝认证");


  /**认证产品代码**/
  private String productCode;

  /**业务代码**/
  private String bizCode;

  /**数据认证服务名称**/
  private String checkBeanName;

  /**认证产品描述**/
  private String desc;


  private AuthProductEnum(String productCode, String bizCode,String checkBeanName, String desc) {
    this.productCode = productCode;
    this.bizCode = bizCode;
    this.checkBeanName = checkBeanName;
    this.desc = desc;
  }

  public String getBizCode() {
    return bizCode;
  }

  public void setBizCode(String bizCode) {
    this.bizCode = bizCode;
  }

  public static AuthProductEnum getAuthProductByProcuctCode(String productCode) {

    for (AuthProductEnum authEnum : AuthProductEnum.values()) {
      if (StringUtils.equals(productCode, authEnum.getProductCode())) {
        return authEnum;
      }

    }

    return null;
  }


  public String getProductCode() {
    return productCode;
  }


  public void setProductCode(String productCode) {
    this.productCode = productCode;
  }


  public String getDesc() {
    return desc;
  }


  public void setDesc(String desc) {
    this.desc = desc;
  }

  public String getCheckBeanName() {
    return checkBeanName;
  }

  public void setCheckBeanName(String checkBeanName) {
    this.checkBeanName = checkBeanName;
  }
}
